/**
 * 按关键词查询对象
 * @author lms 2023.11.01
 */
package ms.core.gateway.request;

import java.util.Map;

import lombok.Data;
import ms.core.common.AppException;
import ms.core.common.consts.SysErr;
import ms.core.tool.JsonTool;
@Data
public class QueryRequest extends QueryPage {
	private String q;			// 搜索关键词，如名称、编号等
	private int state=-1;		// 状态

	public static QueryRequest getInstance(Map<String, Object> body) {
		QueryRequest inst = JsonTool.objectToBean(body, QueryRequest.class);
		if (inst==null)
			throw new AppException(SysErr.SYS_PARAM_ERR);

		return inst;
	}
}